//设置localStorage
export function setCookie(key,value){

  return localStorage.setItem(key,JSON.stringify(value));
  
}

//获取localStorage
export function getCookie(key) {
   try {

        const value = localStorage.getItem(key);

        if (value === null || value === undefined || value === "") {

            return null;

        }else{
            return JSON.parse(localStorage.getItem(key));
        }

        

    } catch (err) {

        return null

    }
}

//移除localStorage
export function removeCookie(key) {
  return localStorage.removeItem(key);
}

